/*
package start.entity;

import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.List;


*/
/**
 * 其实这里的实体对应的就是ES索引 @Document(indexName = "sys_user")
 * 代表映射的是sys_user 索引 @Field(type = FieldType.Keyword) 代表字段应设在es中是keyword类型 ​
 *//*

@Document(indexName = "sys_user")   //文档
@Getter
@Setter
public class SysUser implements Serializable {
    @Id //主键
    private String id;  //ES中id不能定义为Long
    private String username;
    private String password;
    private int level;
    @Field(type = FieldType.Keyword)
    private List<String> roles;

    @Override
    public String toString() {
        return "SysUser{" +
                "id='" + id + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", level=" + level +
                ", roles=" + roles +
                '}';
    }
}*/
